Minor error, there is no need to check for vertex type if adding a new vertex by absolute coordinates.