scala exercise