Added checking direction of move