Solution for problem set #3.