fix bug in Task2 - doesn't processing all combination. Add test cases