Added a more detailed solution to question #5.