candidate solution for 2 part 2