fixed bugs in randomwalk