Scala for the impatient - Chapter {6,7}