finished scala book ch8 functional programming