EJS chapter 6 excercise solutions