scala exercuse from "SCALA for the Impatient"