week 6 code by linjingjian