Course solution with notes adjusted for consistency.