Add solutions for Problem 6.