Improved the replaceAll method to remove punctuation