Added the last planned optimizations and fixed a few bugs. The results are look very nice now