Adding heapsort algorithm