guides algorithm working in example