working part 3 code