moved debug output from parser to main