added the base class to implement priority queue managing elements with their key.