application of matrices and determinants