fixed the parser

and the test cases too