Solution for problem set 6.