Simulating points subject to periodic boundary conditions.
Tidying up simulation code.