Wip sorting/functor