Cleanup of documentation

Cleaned up documentation of the code
Fixed convergence issue
Added a working version of the demo.ipynb