added basic file output functionallity