handling some key presses... some of the code is starting to look a
bit silly now...