Programming in Scala-Odersky Ch5-7