OH MY GOD IT WORKS!!!!! I've never done a conditionals puzzle like this before, so genuinely I was just trying to build something that would succeed, and it did! Yay!