finish part 2 for statistical inference