add functional programming in scala 1