My solution to factorial.rb