Thanks everyone, worked it through and I get it now, sorry if I was a bit slow on the uptake. There is tax either way, but better to be paying tax on a $5380 gain than on a $4000 gain as ultimately you end up with more net.
Sorry if this was a newbie question!