utils_preorder function

Preorder Matrices