added distance calcultion fo vertex class