Also, each of the steps below warrants explanation, either in the docstring or in comments