examples from Ruby Cookbook, Carlson & Richardson