Create some sub methods
Introduce a cursor location variable.
Handle left and right keys.
First cut of delete key handling.
Elaborate handling of delete key.