Identified a critical bug for part 2
Fix issues related to part2.
Simplify part 2 task allocation logic