Added all part 2 code.