Using blocks in newton's method