Implementation of a Priority Queue