Chan's algorithm works principally