improved 005.rb