Code for the scala course