Encounter a problem. Priority queue is not efficient enough.