I need help with the proof of $AC \Rightarrow Zorn$ here http://math.slu.edu/~srivastava/AC.pdf
Specifically the last section of this part:
Using AC, the function $\varphi$ is chosen from the set of all chains in $P$, but then for any $S \in P$ shouldn't be that $\varphi(S) \in S$ ? (because is a choice function, I guess). Instead they are being sent to an element outside the chaing (the set $B(S)$)
Thanks in advance

Let $C$ be the set of all chains in $P$ which do not contain a maximal element of $P$. Let $X = \{B(S)\mid S\in C\}$ (this is the range of the function $B\colon C\to X$ defined in the quote).
And it's this set $X$ that you want to pick a choice function for. (In the quote, it's shown that for all $S\in C$, $B(S)$ is nonempty, so we can do this by AC.)
Let's call that choice function $f$. Then for all $S\in C$, $f(B(S))\in B(S)$. So defining $\varphi = f\circ B$, we have $\varphi(S)\in B(S)$ for all $S\in C$, as desired.