Improved moveInDirection