add Vertex.java and changes in main