Modified code for fund_out.