Separated MLP calculations and filling of "path" array with intersected voxels into a separate function (find_MLP_path) that accepts "path" and "chord_length" arrays by reference so these can be filled by the function and when it returns these arrays still have valid scope in the calling function so they can be accessed outside find_MLP_path.