Possible bug fix to formula for double integration. Unsure.