i think i implemented double buffering correctly this time