fix bug in hw4