simulating particle motion