added vertices calculation