fixed bug in jacobi