Issue #36: I replaced the 4 else if statements with one atan2 function