Add task2 and refactor parser and task1
Simplify task2 main