updated calculations based on proper quadrature formula