optimize by newton