More work on the residues chapter