Having issues with getting this working. My plan for it is to be used to calculate reference angles for an inputted angle. Any help would be appreciated. One of the errors I've noticed is when I try to type, for example: -500. It spits out 220 (which is correct due to adding 720 to -500 to keep it within the range of 0-360). But the reference angle that was given is 90.

**Code:**```
```

ClrHome

Input "ANGLE: ",A

A→B

ClrHome

While B<0:

B+360→B

End

If B>360:

remainder(B,360)→B

Output(1,1,"ANGLE: ")

Output(1,8,A)

Output(2,1,"UNWOUND ANGLE: ")

Output(2,16,B)

If B=0 or B=180:

Output(3,1,"REF. ANG. IS: 0")

Else:If B=90 or B=270

Then

Output(3,1,"REF. ANG. IS: 90")

Else:If B>0 and B<90

Then

Output(3,1,"REF. ANG. IS: ")

Output(3,15,B)

Else:If B>90 and B<180

Then

Output(3,1,"REF. ANG. IS: ")

(180-B)→B

Output(3,15,B)

Else:If B>180 and B<270

Then

Output(3,1,"REF. ANG. IS: ")

(B-180)→B

Output(3,15,B)

Else:If B>270 and B<360

Then

Output(3,1,"REF. ANG. IS: ")

(360-B)→B

Output(3,15,B)