working version also checked for clt