Updated keyboard code to work