Simplified the movement code into one "action".