Slightely changed the word break ii algorithm