More work on residues chapter