Debugging the keyboard function... almost there