Hw issue 31

fix some little problems according to the review comments