Trying to reason this out from first principles since the script doesn't work right.