adding the infrastructure for error calculations