added sentence handling