added function clearUnusedVertices