part 1
fix bug in part2
a1 part3