Solution to Problem 18

- Still need to revisit this to understand better
- Small typo in Problem 15