tinkering with newtons method