Use a sorted set for best-first