changed $string[$i] to $letter