changed to listening for commands on stdin