x y z res 0 0 0 1 0 0 1 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 0 --> problematic line - if I use signals instead of vars, I get this result as 1 1 1 1 1