added corner case fix for potential angle sorting problem caused by atan2 wrapping