revised to parse sentence by sentence