build randomwalk functionality