added cbc function