working on the array-version of sub-sample extrema.

Non-array version has proved to be fully functional.