Update Matrix.scala