Added random walk function