Vertex removing and modifications

Remove vertex function added, some logic changed.