week 5 solutions by chenhao