getting closer... fit.hpp is a lot neater. uses some attempt at an adaptive minimum finding method based on the previous mean. snow is knackered again...