     subdivide = (T, t, p) ->
       trace "subdivide [#{T.triangulation__.toSeq()}], #{t}, #{p}"
       [a, b, c] = t.vertices()
-      n = T.position__.length
+      n = T.nextIndex__
       new T.constructor(
         T.triangulation__.minus(a,b,c).plus(a,b,n).plus(b,c,n).plus(c,a,n),
-        T.position__.concat([p]),
+        T.position__.plus([n, p]),
+        n + 1,
         T.sites__.plus(p),
         T.children__.plus([T.find(a,b,c),
                            seq tri(a,b,n), tri(b,c,n), tri(c,a,n)])

      new T.constructor(
        T.triangulation__.minus(a,b,c).minus(b,a,d).plus(b,c,d).plus(a,d,c),
        T.position__,
        T.sites__,
        T.children__.plus([T.find(a,b,c), children], [T.find(b,a,d), children])
      )

    # triangle a new site is in.
    constructor: (args...) ->
      @triangulation__ = args[0] || triangulation(outer.vertices())
      @position__      = args[1] || new IntMap()
      @nextIndex__     = args[2] || 0
      @sites__         = args[3] || new HashSet()
      @children__      = args[4] || new HashMap()

    # The method `toSeq` returns the proper (non-virtual) triangles contained
    # in this triangulation as a lazy sequence. It does so by removing any
