Working on the kbhit problem