Adding solutions for problem 7