writing for part 4 of lecture 9.