Merge pull request #37 from Winston-Chan/nathan

Added checks for garbage lines in parser.
Printer now does not overwrite the input file...
Merge remote-tracking branch 'origin' into nathan