Modified parser, code clean up and comments