I wrote this logic out the long way, for super clarity (hopefully)