reordering for non-adjacent cells