added primitive midpoint intgeration to prep