added implementation of the max heapify algorithm