0

I'm currently reading the paper: https://arxiv.org/pdf/1802.06002.pdf

I'm a little bit stuck on the step of how to determine the following quantity:

Where U is a unitary operator acting on $|z,1\rangle$. The paper states the following:

I'm completely confused with the transition between expression 27 to the expression right after. How does applying a Hadamard to the auxiliary qubit result in the expression:

$$\frac{1}{2}(|z,1\rangle + iU|z,1\rangle |0\rangle) + \frac{1}{2}(|z,1\rangle-iU|z,1\rangle |1\rangle)$$ Shouldn't it result in $$\frac{1}{2}(|z,1\rangle |0\rangle + iU|z,1\rangle |0\rangle) + \frac{1}{2}(|z,1\rangle |0\rangle -iU|z,1\rangle |1\rangle)$$

And if this is the case, I'm confused as to how the probability of the auxiliary qubit being 1 is $\frac{1}{2}-\frac{1}{2}Im(\langle z, 1|U|z,1\rangle)$. Could someone explain why this is the case, and perhaps what I'm missing here?