Changed SimpleMatrix to 2-d array.