updated error calculations