added quadratic error quantifcation