Added triple buffer to avoid gaps between frames.