Added priority queue with function class (works)