My solution for coursera scala course