corrected periodic boundary conditions