added require to midpoint example