double buffer functional if non optimized