The problem with the code is that "slope" is a defined function, and it is this line that is cfreating the problem:
(if (= slope nil) (setq slope -.002))
-.002 is NOT a real number so lisp is interpreting it as a new subroutine. Change it to be -0.002 and all will be well.