needless passing of variables.

profile_idx and vertex idx are easy to confuse, this avoids mixing them.