Some warmup problems in scala