removed erroneous const; added hasVertex function