One possible solution to exercises from the scala tutorial from the SF-Scala meetup