added three main functions to parse on the initial text -BP