functional programming in scala review