Turns out I'm pretty dumb. Or I need to stop coding late at night.