First part of exercise 6