Change differentiation algorithm so that it is easier to understand what it does (just one step at a time) and use it to check
deltas between subsequent values, using a step of 1.