Task 2 of the programming assignment 1