solve problem 5, edit comments on 3 and 4