scala exercises (P56)