add detailed comments

todo: brokenvertices and brokenedges should be loaded from outside.