toggle for Q machine