optimize the log model