Added kbhit and made things generally better