add avg_end_balance.c