added reading from STDIN