oops, im stupid.

i needed to put all the dims in the if block.