Priority queue implemented