add second implement for heap sorting