Matrix program that can handle arithmetic operations