various refinements
cleanup extraneous print statements
added new functions for arrow keys, backspace and delete (solution for
mac didn't work on windows)