Final version of coding excercise