fix minor bugs
add newton's method