```
Prompt A,B,C
0->D
B->E
-1+2(B>0->X
-Ans->Y
Repeat D+E=B and DE=AC or abs(D)>abs(AC
D+X->D:E+Y->E
End
If abs(D)>abs(AC
Then
Disp "UNFACTORABLE
Stop
End
gcd(abs(A),abs(D->H
A/Ans->F
D/H->G
gcd(abs(E),abs(C->K
If E<0 or C<0
-K->K
ClrDraw
Text(-1,1,1,A,"X^2+",B,"X+",C
Text(-1,10,1,"FACTORS TO
Text(-1,20,1,"(",H,"X+",K,")(",F,"X+",G,")"
Pause
ClrDraw
ClrHome
```

Any optimizations would be appreciated, as well as an explanation for why I get an error with the gcd( command and negative numbers. Also if anyone knows a simple way to make it display a minus sign instead of a plus negative that would be great for the aesthetics

Thanks