a working spreadsheet from "Programming in Scala" chp 35