And then if you, plug this in here, you see that if it's constant, then it's zero, then essentially the second term here disappears, and the output of my first qubit will be zero, and if the function is balanced then this here will cancel itself out and you get as a result, one. 