Refactored *everything*. This copy works!