separate stdin reading and file reading;