the assignment from the scala course.