almost created the double buffering;