added better support for mixed-case inputs
merged fix for mixed-case inputs