1st version, take single line input but take care of last punctuation