Implemented the Heap data structure