cleaned up/simplified longestValidWord2