Now calculate all the matrix