update source code for Optimization