changed the flow of keylistening. I made it an array of functions corresponding to key down and key up