Code from the tutorial in the last chapter of Programming in Scala, with minor adaptations to account for changes to scala in 2.11