Added getRandomPath func