heap sort with trees failed attempt