Trying out Scala problems from http://aperiodic.net/phil/scala/s-99/