Calculating Resonances Using a Complex Absorbing Potential