Priority queue works