def split_words(text)
  return word_list = text.downcase.scan(/\w+/)
end

def word_count(text)
  word_list = split_words(text)
  count_list = []
  for word in word_list do
    update_count(count_list, word)
  end
  return count_list
end

def sample_text() 
  return "One of the first big users of the telegraph was the
    Associated Press: one of the original 'wire services.'  News is,
    of course, more valuable if it arrives quickly, so the telegraph was
    a valuable tool for the AP.  Recognizing that, the AP realized that
    its competitive position, relative to other press services, would
    be enhanced to the extent it could keep the telegraph to itself. So
    it signed an exclusive contract with Western Union, the telegraph
    monopoly. The contract gave the AP favorable pricing on the use of
    the wires. Other press services were priced out of the use of the
    'carrier.' And as a result, the AP got a lock on news distribution so
    strong that it threatened the functioning of the American democracy. It
    passed the news about politicians it liked and omitted mention of those
    it did not.  Freedom of the press existed in theory, but not in practice,
    because the content industry controlled the carrier."
end
