 }
 
 __global__ void train_model_kernel(const long long *cache, const long long cache_length, const long long layer1_size,
-                                   struct vocab_word *vocab, real *expTable, real *syn0, real *syn1,
+                                   const struct vocab_word *vocab, const real *expTable, real *syn0, real *syn1,
                                    Lock *lock)
 {
     const unsigned int thread_idx = (blockIdx.x * blockDim.x) + threadIdx.x;

    const long long cache_end = get_fragment_end(cache, cache_length, thread_idx);
    long long word, last_word, word_count = 0, last_word_count = 0;
    long long word_count_actual = 0; // overwrite __device__ global variable word_count_acutal
    long long cache_idx = cache_begin, local_iter = iter;
    long long sen[MAX_SENTENCE_LENGTH + 1], sentence_length = 0, sentence_position = 0;
    long long a, b, c, d, cw, l2;
    unsigned long long next_random = (long long) thread_idx;
    real f, g, alpha = 0.05; // overwrite __device__ global variable alpha
    //real *neu1 = (real *) malloc(layer1_size * sizeof(*neu1));
    //real *neu1e = (real *) malloc(layer1_size * sizeof(*neu1e));
    real neu1[200];
    real neu1e[200];

    while (1) {
        if (word_count - last_word_count > 1000) {
            //lock->lock();
            word_count_actual += word_count - last_word_count;
            last_word_count = word_count;
            alpha = starting_alpha * (1 - (long long) (word_count_actual * blockDim.x * gridDim.x) / (real) (iter * gpu_train_words + 1));
            if (alpha < starting_alpha * 0.0001) alpha = starting_alpha * 0.0001;
            printf("%dAlpha: %f  word_count_actual: %lld  blockDim.x: %ud  gridDim.x: %ud  iter: %lld  gpu_train_words: %lld", alpha, word_count_actual, blockDim.x, gridDim.x, iter, gpu_train_words);
            //lock->unlock();
        }
        
        if (sentence_length == 0) {
            while (1) {

    vocab_hash = (int *)calloc(vocab_hash_size, sizeof(int));
    expTable = (real *)malloc((EXP_TABLE_SIZE + 1) * sizeof(real));

    CUDA_CALL(cudaMemcpyToSymbol(alpha, &param_alpha, sizeof(param_alpha)));
    CUDA_CALL(cudaMemcpyToSymbol(starting_alpha, &param_alpha, sizeof(param_alpha)));
    CUDA_CALL(cudaMemcpyToSymbol(iter, &param_iter, sizeof(param_iter)));
    CUDA_CALL(cudaMemcpyToSymbol(sample, &param_sample, sizeof(param_sample)));
