Collision avoidance algorithm for small UAS