refactored
use functions
flip_KZ_buffer()
refactor
inline for speed
inline for speed
debugging -- there's an issue with swap not swapping