Optimization. and correct some problems.