Implement double-buffering scheme