newton implemented as a separate method (for square, under- and overdetermined systems)