added priority queue solution