calculates determinant using recursive definition