takes a sentence and calculates it