changed reordering to rcm in test_mex