Added leader key and swap buffers