added in smart movement with arrow keys