introduced naive stable sorting