modified version of cltest