Fixed bugs on algorithm 3.2
Refactored algorithm
Merge branch 'test_parser'