priority queue implemented
priority queue implemented - 2