Implementation of generic  HeapSort and some new issues