Changed the solution to reflect the presentation