add code for discussion 8