Updated per thread index hash generating code