calculating integrals