Solutions to exercise 1