Modified code for new parser.