Update thinning algorithm.