Simpler solution.
Exercise 6
exercise 7
reverted
Exercise 12
fix