Added nonrecursive sort