Chap2 Scala book notes