Added qr newton implementation and better comparison code