fixed bug in quadratic integration