replace getVertex(by index) implementation