migrated js to separate file, added keydown bind