Separating Overlapping UI elements

I am having trouble getting UI elements to separate.

Here is a link to a video that describes what I am taking about.

As you can see in the beginning they separate pretty good.
But as more labels are added they start to overlap.

I am using SAT to check for collisions and using the returned MinimumTranslationVector to figure out how far they should split.

The code used to see if they collide was taken from here:
http://www.codeproject.com/Articles/15573/D-Polygon-Collision-Detection

 public void AddItemLabel(GameObject label)
    {
        int n = 0;
        itemLabels.Add(label);

        Dictionary<int, Vector2> vecHold = new Dictionary<int, Vector2>();

        for (int i = 0; i < itemLabels.Count; i++)
        {
            for (int j = i + 1; j < itemLabels.Count; j++)
            {
                PolygonCollisionResult pcr = LabelHelper.PolygonCollision(itemLabels*.GetComponent<ItemLabel>().GetPolygon(), itemLabels[j].GetComponent<ItemLabel>().GetPolygon(), new Vector2());*

if (pcr.WillIntersect)
{
Vector2 half = pcr.MinimumTranslationVector / 2;

if (vecHold.ContainsKey(i))
{
if (vecHold*.magnitude < half.magnitude)*
{
vecHold = -half;
}
}
else
{
vecHold.Add(i, -half);
}

if (vecHold.ContainsKey(j))
{
if (vecHold[j].magnitude > half.magnitude)
{

vecHold[j] = half;
}
}
else
{
vecHold.Add(j, half);
}

n++;
}
}
}

if (n > 0)
{
for (int k = 0; k < itemLabels.Count; k++)
{
if (vecHold.ContainsKey(k))
{
itemLabels[k].GetComponent().anchoredPosition -= vecHold[k];
}
}
}
}

Although I did get the code above working correctly, it was way to slow to use.

But I Finally solved the problem using a much easier method.

Hopefully this code will help someone else with a similar problem.

    public int AddLabel(GameObject label)
    {
        int output = labels.Count;
        labels.Add(label.GetComponent<ItemLabel>());
        labels.Sort();

        for (int i = 0; i < labels.Count; i++)
        {
            ItemLabel labelA = labels*;*

for (int j = i+1; j < labels.Count; j++)
{
ItemLabel labelB = labels[j];

if((labelB.MaxY() >= labelA.MinY() && labelB.MaxY() <= labelA.MaxY()) ||
(labelB.MinY() >= labelA.MinY() && labelB.MinY() <= labelA.MaxY()))
{
labelB.SetPosition(new Vector2(labelB.GetCenter().x, labelA.MaxY() + labelB.GetHeight()));
}
}
}

return output;
}