add optimization part