         double Y_N = 1.0;
         for (int i = 0; i < NSP; ++i)
         {
-            buffer[i] = y_host[padded * i + j];
+            buffer[i] = y_host[NUM * i + j];
             Y_N -= buffer[i];
         }
         buffer[NSP] = Y_N;

    __device__ int integrator_steps[DIVERGENCE_TEST] = {0};
#endif

void write_log(int padded, int NUM, double t, const double* y_host, FILE* pFile)
{
    fwrite(&t, sizeof(double), 1, pFile);
    double buffer[NN];

    sprintf(out_name, "log/%s-log.bin", f_name);
    pFile = fopen(out_name, "wb");

    write_log(NUM, 0, y_host, pFile);

    //initialize integrator specific log
    init_solver_log();
