added Q command to quit