soltion to part 3