Solved up to exercise 5