class reading and outputting file