Replace confusing min/max selection logic