Accomodating both upper and lower case input for algorithm.