wip sort
fixed sort, added test