Refactor the matrix script
Rename