Added a getDirection() method