changed output filename, added some comments