Refactored newLetterIndex within the encrypt method