start to implement question 4 but there is a bug