make changes to calculate num vertices