Corrected Process_Sentences function