establishes X and Os switching