Depend on the bank, i reckon.

We have the mortgage with a credit union and are $x,000 ahead. So we don't pay interest on the $x,000. [Interest = % x (Total -x,000) ]

I think that if we wanted to take the $x,000 out again, we would just have to pay interest on this amount again. [Interest = % x Total]

That is how it would work, if i ruled the world anyway.