diff --git a/kwant/lattice.py b/kwant/lattice.py
index 53d86d5db23d634ec2e0a7071e4a18aa7f62f1fb..2885fd37e7492c61a9e1438e6dfa4233dbeb19f4 100644
--- a/kwant/lattice.py
+++ b/kwant/lattice.py
@@ -155,7 +155,7 @@ class Polyatomic(object):
 
                 ij_dist = [np.linalg.norm(i(*tag).pos - origin)
                               for tag in tags]
-                sites.append((tags, (i, j), ij_dist))
+                sites.append((tags, (j, i), ij_dist))
             max_dist = [i[2][-1] for i in sites]
             distances = np.r_[tuple((i[2] for i in sites))]
             distances = np.sort(distances)