reordering slots into rows