adding midpoint