update cachmatrix