extended bound to work for periodic bcs