Here's the solution to problem 5 from the practice problems.