Last cleaned up version with helper class to search for extremes
Some extra tests on this helper stuff