made debug mode and added sentence splitting