It is always better to define input data source in list of list for maths calculation. It is easy to convert them into matrix and array 2d. For example,
1


will result
1


This can be easily be converted as Matrix.
1


results
1 2 

To convert into Array2D by
1


results
1 2 
