change variable name to "pathIndex"