fix the bug and finish question 2.4