Rory table logic refactored to prepare for automatic video generation and bug fixes