Fixed a few formatting and commenting errors. Added data output file creation into main()