refined problem 5 answer a bit