Small improvement in while loop for simpilicity.
Added 'q' and 'Q' options for exit
added a space in output where needed