Program for matrix operations