Looking at the example from the last video in a more generalized way
License: CC BY-NC-SA by Khan Academy