solved using cholesky