Implemented collision detection for arrow keys as well.