added vertices optimization