skeleton for heap sort