Week 3 homework for Ruby programming