modified: input parsing
added:    output file setup