some scala training code to let students do