Updated code for 6_string.rb