added vertex class, but it is going to be replaced by a hashmap