Finish minheap.js