Random coherency cost & improve script