Adds double buffer support to stop flickering