changed implementation of getMovementDirection method