Altered main function. can now plot error graphs