[186-I] (WIP) Change algo, now using line pattern rec.