Adding the functionality of esc and left and right arrow.