add code for reading from stdin