testing periodic boundary conditions