Updated keyboard code