Make algorithm recursive.
Add 1.18.