corrected 'hk' to 'jk' on main screen
moved some code to separate files