Changed most SimpleMatrix to double[][]