Added some error catching to program, won't allow bad simulation parameters to go through.