Removed kbd_closed function which was no longer being used anyway.