fix the computation of the code length for communities