Improving example, adding newton basic algorihm