Added part 4 code