         //allocate gpu mem
         checkCuda(cudaMalloc((void**) &str_in_cuda, size));
         checkCuda(cudaMalloc((void**) &str_out_cuda, size));
-        checkCuda(cudaMalloc((void**) &sizes_cuda, sizeof (int)*PARTITIONS));
+        checkCuda(cudaMalloc((void**) &sizes_cuda, sizeof(int)*PARTITIONS));
         //int i;
         /*for (i = 0; i < PARTITIONS; i++) {
             

		}
	} while (len > 0);	/* until length of string to be processed is zero */
	if (code_buf_ptr > 1) {		/* Send remaining code. */
		for (i = 0; i < code_buf_ptr; i++) str_out[codesize+i+offset] = code_buf[i];
		codesize += code_buf_ptr;
	}
	//printf("In : %ld bytes\n", textsize);	/* Encoding is done. */

        //cudaMemcpy(str_in_cuda, str_in, size, cudaMemcpyHostToDevice);
        checkCuda(cudaMemcpy(str_in_cuda, str_in, size, cudaMemcpyHostToDevice));

        // kernel call - save all encoded files to array elements
        // run function on GPU <<<blocks, no_of_threads>>>

        EncodeCUDA << < 1, PARTITIONS >>>(size, str_in_cuda, str_out_cuda, sizes_cuda);

        // TODO: copy back to RAM from GPU
        //cudaMemcpy(str_out, str_out_cuda, PARTITIONS * sizeof (char*), cudaMemcpyDeviceToHost);
        checkCuda(cudaMemcpy(str_out, str_out_cuda, size, cudaMemcpyDeviceToHost));
        //TODO: :cudaErrorInvalidValue Error Code : 11

        /*for (i = 0; i < PARTITIONS; i++) {
            //cudaMemcpy(str_out, str_out_cuda, (size / PARTITIONS + size % PARTITIONS) * sizeof (char), cudaMemcpyDeviceToHost);
            checkCuda(cudaMemcpy(str_out, str_out_cuda, (size/PARTITIONS + size%PARTITIONS)*sizeof(char), cudaMemcpyDeviceToHost));
        }*/
        
        cudaMemcpy(sizes, sizes_cuda, sizeof(int)*PARTITIONS, cudaMemcpyDeviceToHost);
        //checkCuda(cudaMemcpy(sizes, sizes_cuda, sizeof(int)*PARTITIONS, cudaMemcpyDeviceToHost));

        // file write
        for (i = 0; i < PARTITIONS; i++) {
            //printf("part %d - %d\n", i, sizes[i]);
            char fileName[strlen(s)+5];
            // creating file names
            sprintf(fileName, "%s.%d", s, i);
            //printf("%s\n", fileName);
            FILE * out = fopen(fileName, "wb");
            //s[strlen(s) - 2] = '\0';

            // write encoded
            int offset = (size/PARTITIONS) * i;
            writeFile(out, i, sizes, str_out, offset);
        }

        /*
        time_t end = time(NULL); // - start;
        printf("\nEnd time: %ld\n", end);
        printf("\nTime taken: %f\n",difftime(end, start));
		    */
    } else {
        // Decode
        int part = 0;
