Basic implementation of exercise 2.