working on determinant method