add local optimization