Add error check for periodic bcs

* fold in new CHT algorithm...