Scala puzzles