added elsif to accept quit, and go to end of loop.