Fix wrong uses of code and add some comments
Add a tutorial
Improve path generating algorithm
Fix issues about the algorithm