finished part 1 of exercise