cleaned up, added key press event