Debugged coherencee script.