My Programming Excercise in Scala