Implemented math on Matrix.