A method of allocating identifying codes to basestations forming part of a group of basestations within a cellular communications network, the method comprising, in each basestation within the group: selecting an identifying code in a manner that attempts where possible to avoid selecting the same identifying code as a neighbour, and the method further comprising, in at least one basestation within the group: determining that a clash has occurred if any neighbour basestation has selected the same identifying code as said at least one basestation, and if a clash has occurred, determining whether the clash can be resolved by said basestation or by another basestation in said group, further comprising, if a clash has occurred: determining whether there are any identifying codes that are not in use by neighbours of the basestation; and if so, selecting an identifying code that is not in use by a neighbour of the basestation; and characterised by: if there are no identifying codes that are not in use by neighbours of the basestation, for one or more basestations, calculating a freedom of selection parameter, based on a number of identifying codes potentially available for use by that basestation and on a number of said available identifying codes that are actually in use by neighbours of that basestation; identifying a neighbour that has a high freedom of selection of an alternative identifying code; and selecting the identifying code that is in use by that neighbour. selecting an identifying code in a manner that attempts where possible to avoid selecting the same identifying code as a neighbour, and the method further comprising, in at least one basestation within the group: determining that a clash has occurred if any neighbour basestation has selected the same identifying code as said at least one basestation, and if a clash has occurred, determining whether the clash can be resolved by said basestation or by another basestation in said group, determining that a clash has occurred if any neighbour basestation has selected the same identifying code as said at least one basestation, and if a clash has occurred, determining whether the clash can be resolved by said basestation or by another basestation in said group, further comprising, if a clash has occurred: determining whether there are any identifying codes that are not in use by neighbours of the basestation; and if so, selecting an identifying code that is not in use by a neighbour of the basestation; and characterised by: if there are no identifying codes that are not in use by neighbours of the basestation, for one or more basestations, calculating a freedom of selection parameter, based on a number of identifying codes potentially available for use by that basestation and on a number of said available identifying codes that are actually in use by neighbours of that basestation; determining whether there are any identifying codes that are not in use by neighbours of the basestation; and if so, selecting an identifying code that is not in use by a neighbour of the basestation; and characterised by: if there are no identifying codes that are not in use by neighbours of the basestation, for one or more basestations, calculating a freedom of selection parameter, based on a number of identifying codes potentially available for use by that basestation and on a number of said available identifying codes that are actually in use by neighbours of that basestation; identifying a neighbour that has a high freedom of selection of an alternative identifying code; and