Rearranging gems