Exercise of algorithm