split function: randomWalkSampling() into two parts: load and sample