Finished #31

Took me WAY longer than I would have preferred, but I think I have an
okay grasp on what was going on here. Simplified the code to match my
new understanding, and changed variable names to be more descriptive.