hsort impl