Matrices calculations added.