fixed so it writes to stdout instead of reading the file in and printing it out again to the same file...