fixed periodic BC, updated scripts and ftns