Faster finding of min/max value when removing old x-values