Added argument parsing
Added output file handling