Solution 6
Solution 7
Problem 8 solution