initial priority queue version