solve problem #4