added maxima-finder code with stepping