added cdlFunc.R