completed ctt functions