finished script to parse document into sentences