My solution to reverse.rb