moved normal framebuffer code