Method to calculate the determinant implemented.