Remove rand() calls