Added solutions for exercises 2 and 4