working on newton (not finished)