Balancing oxidation and reduction reactions