Added tolerance to newton