Simplified and sped up the sentenceprob.py file