Rewrote program to check incrementally for object to avoid; implemented timer for moving back to original position. The program now works.