Half way through writing R random walk function