Pretty fun, although there's a memory leak (I think you're not releasing the arrays that are sorted, but instead keeping them somewhere that the garbage collector can't reach them from)