SortedPriorityQueue implemented and tested