changes to solve problem 8