still working on sorting sans recursion