added determinant function