answer to the book "Scala for the Impatient"