Lots optimizations
Bugfix

Lost of optimizations
Lots of small fixes
Still have a few problems