Added comments
Modified to write output to file specified in argv[2]