write clarity example to illustrate the algorithm