Midpoint algorithm changes

Preliminary proper implementation of midpoint calculation for real
valued features