C: Adding error calculation.