commented error calculation