file_reader modified to accept stdin