some examples updated from "why's poignant guide to ruby" and some code to make it easier to understand