Turned the code section: "if(direction == "left")" to "if(direction.equals("left"))" so that the if statement would compare content rather than memory address.