Beautiful vertices

please help me to find the mistake in the code.

the link to the code is :-