Flocks of birds are highly variable in shape in all contexts (while travelling, avoiding predation, wheeling above the roost). Particularly amazing in this respect are the aerial displays of huge flocks of starlings (Sturnus vulgaris) above the sleeping site at dawn. The causes of this variability are hardly known, however. Here we hypothesise that variability of shape increases when there are larger local differences in movement behaviour in the flock. We investigate this hypothesis with the help of a model of the self-organisation of travelling groups, called StarDisplay, since such a model has also increased our understanding of what causes the oblong shape of schools of fish. The flocking patterns in the model prove to resemble those of real birds, in particular of starlings and rock doves. As to shape, we measure the relative proportions of the flock in several ways, which either depend on the direction of movement or do not. We confirm that flock shape is usually more variable when local differences in movement in the flock are larger. This happens when a) flock size is larger, b) interacting partners are fewer, c) the flock turnings are stronger, and d) individuals roll into the turn. In contrast to our expectations, when variability of speed in the flock is higher, flock shape and the positions of members in the flock are more static. We explain this and indicate the adaptive value of low variability of speed and spatial restriction of interaction and develop testable hypotheses.