Random walks and the Hagedorn transition