Set up main file and added some error handling to parser.