downcase before inner loop