Corrected files from last commit.  Added error handling and file output.