added an exit command and immediate character recognition