Solution for the scala course from Coursera