added opt. code and pp on optimizations