scala exercises (P64)