Clean cusp point algorithm