updated parser to be tolerant of \n \n\r