Programming assignment 2 for cathe_Matrix