added a queue data structure that allows access to the max element in constant time.