Adding solution for exercise 1.c