added graphing and error testing