added first time periodic boundary - unbugged