fixed cdlFunc.R