had to comment out jacobian calculation as advised by KDykes.