newell algorithm