Commentz-Walter algorithm