added solution for newton exercise