fixed x keypress

still need to clean up code