Wrote a heapsort