 
             for(size_t out_z = 0; out_z < output_size_z; out_z++)
             {
-                size_t mat_out = n*output_size_x*output_size_y*output_size_z + (out_x + min_out_x)*output_size_y*output_size_z + (out_y + min_out_y)*output_size_z + out_z;
+                size_t mat_out = n*length_x*length_y*output_size_z + out_x*length_y*output_size_z + out_y*output_size_z + out_z;
 
                 const float_type prev_inf_coeff = expr_inf_coeff[mat_out];
                 const float_type prev_sup_coeff = expr_sup_coeff[mat_out];

            for(size_t out_z = 0; out_z < output_size_z; out_z++)
            {
                size_t i = (out_x + min_out_x)*output_size_y*output_size_z + (out_y + min_out_y)*output_size_z + out_z;

                size_t a = n*output_size_x*output_size_y*output_size_z + i;

                const float_type lb = lb_array[i];
                const float_type ub = ub_array[i];


    if(fp->layers[layerno]->type == CONV)
    {
        std::cout << "INITIAL" << std::endl;

        std::cout << "Parameters: " << std::endl
