this is a source code of functional programming in scala course example assignment answer