well, first off, let's see how much was made in the first 3 years.
for the first 2 years
now for the following year, at 4% compounded monthly
now, we're 3 years later and 8000 bucks get pulled out of it, so the remaining balance is simply 16217.20 - 8000 ≈ 8217.20.
now, let's get the amount of that new balance of 8217.20 still at 4% rate compounded monthly for the last 3 years.