added midpoint integration to prep