animation examples and random walk function