tried to rewrite newton