Added Optimization codes