working code in preservedVGACool