Added functionality so that the snake can't reverse directions