work on new matrix
New usage of matrices in memory finished
Merge with branch NewMatrix