undo last change where median was used for delta.  go back to using max but base it on total distance to both neighbours and compare to step instead of using max neighbour and comparing to half step