Added support for keyboard input and cleaned up the code. Improved functionality of the del button.