I finally understand this LCP algorithm