Refactor dinosaur.rb for arrowhead programming