code cleanup. And minor extendsion to the keyboard library,