solved: problem 6