Changed the direction variable from int to char to increase readability.