Turned the code section: "if(direction == "left")" to "if(direction.equa...

...ls("left"))" so that the if statement would compare content rather than memory address.