added part of newton loop