shuffle matrix