Add solution for exercise 5 assignment 2