add rudimentary numerical quadrature using legendre polynomials