Added random walk functionality with javascript