updated substrings.rb