implementing mergesort for the first entry in the kd-tree. so the
triangles are once sorted after their x values