newton: code organization