Small exercise problems in Ruby