changing paths to integer indices