Recursive implementation of the determinant calculation.