Code:
if ( angle > 0 & angle <= 90 )
This should be the logical operator &&, not the bit operator &.
Personally, I always write multiple expressions in the following form. It is more readable
and forces the precedence I want. I have to type a few more keystrokes but it is worth the correctness and clarity.
Code:
if ( (angle > 0) && (angle <= 90) )
Otherwise someone who knows the functions you are calling will have to help you.