Updated culture detection script