scala week2 assignment