removed rendundancy in checkVertex