added code to parse sentences