moved location of limit switch response.  And changed some constants.
adjusted p loop