calculate extrema on the fly, use set-based queue [sic], N in Stats