functional insertion hsort works