More clearly sorts. Still needs code cleanup