Working on refactoring and optimizing.
Simple test-suite for sub_sample_extrema