Updated the code for isLower and isUpper