scala lecture 4.2