wrote heapsort for hw 18