If ( ax < bx) Or (bx - ax >= 180) Then

Gosub cwise
Endif
this will work if your math is correct