new way to compute the error (eim)