fixing binary sequence