add while loop to log keystrokes