Well it's sort of working but it's not sorting right
Good ol' fashioned functional recursion seems to work best.
We don't need no stinkin' closures!