fixed problem with perpendicualr motion