proper double buffering this time