keypresses working correctly