actually implement periodic bcs