Algorithms for calculating coherent anti-stokes Raman spectra: Application to several small molecules