Class work and example of an algorithm