After the Trustee collects all assets he/she is permitted to collect and turns those assets into cash, he/she pays claims based upon the distribution permitted under 11 USC 726. Once the money is gone he/she does a final accounting and the Clerk closes the case. This has nothing to do with the Debtor but for any assets the Trustee takes from the Debtor and/or any settlements with the Debtor due to the loss of some asset or other controversy.
Edt to add: Oh, and, if, after payment of all claims there is money left over the money is returned to the Debtor.
Des.

