Assignment 1 of scala course