fixed bugs hw2:3 final