continue writing the python implementation of CC