Almost done with optimizations