Now reading from standard input

Made changes to read from standard input from Olena's emailed code.