initMatrices adjusted