Added threadlocal random generator