Updated error handling and comments
Changed the name of the main program file