Commented RearrangeMatrix