In the following sentence, I don't understand the grammatical function of 자 in 잦아들자. "물론이죠," 나는 심장이 쿵쾅거리는 것이 잦아들자 톤을 가다듬고 다시 대답했다. "뭔데요?" I understand that the sentence basically means something like, " 'Of course," I answered, trying to reply in an even voice, even as my heart was pounding and sinking." But I can't figure out how it fits together grammatically. Could anyone explain???