min max pq median wip