remove duplicities
remove unused vertexes