Residues and Contour Integration Problems