Implemented linked list for vertices.