periodic boundaries work somehow