Final draft of hw7.rb