rearrange samples