Multi-wavelength investigation of energy release and transport in the 16 August 2004 flare