changed binding for keydown to body, and used jquery instead of plain js