still some glitches, but basically works.  need to clean up white flag handling and make vsync more robust