fixed double_balance, reorganized some sections