1. A method for determining a sewing order in embroidering at least one embroidery element on a sewing material stretched in a stretching device mounted on an embroidery unit in a sewing machine, which has access to a memory for stitch data for said embroidery element and a processor for reading said stitch data and for maneuvering the sewing machine to execute stitches according to stitch data, said minimum of one embroidery element being composed of basic elements, and only one sub-area of the sewing material stretched in the stretching device that is to be embroidered being accessible for sewing, said basic elements comprising at least the characteristics, sub-area, colour and thread type, the method comprising: forming clusters of basic elements with the characteristic that the basic elements in the cluster must be sewn on the same sub-area and the formation comprising an overriding priority based on the order in which the basic elements are added when composing the embroidery that is to be sewn on the sewing machine, determining of a level for each cluster, sorting of the clusters with regard to their respective characteristics, colour and thread type, and sorting of the formed and sorted clusters into a sewing order based on said characteristics.