Made C={0,..,3} depending on the case see get_perim_from_initial_tign