fix some more issues with finding the high and low regions
seems to work well now, but needs a bit of code cleanup