fix integral and missing pi