O3 and other optimizations