encapsulated a lot into inner Vertex class; resizing OK is done slowly