 			m_set(MatrixCA, i-1, j, m_get(MatrixCA_line, 0, j));
 		}
 		m_free(MatrixCA_line);
-		tmp_MatrixAp = m_multiplyblockdiag(MatrixAp, MatrixA, 2);
+		MatrixAp_tmp = m_multiplyblockdiag(MatrixAp, MatrixA, 2);
 
 		m_free(MatrixAp);
-		MatrixAp = tmp_MatrixAp;
+		MatrixAp = MatrixAp_tmp;
 	}
 
 

	blocksize = 100;

#if MODE == 1
	Matrix device_MatrixAp, device_MatrixCA, device_state_read, device_state_write, device_tmp_state, device_output_chunk_read, device_output_chunk_write, device_tmp_output_chunk;

	device_MatrixCA = m_new(blocksize, MatrixA.cols);
	device_output_chunk_read = m_new(blocksize,1);

		for(j = 0; j < blocksize; j++) {
			output[i+j] = m_get(output_chunk,j,0)/128;
		}
		state_tmp = m_multiplyblockdiag(MatrixAp,state,2);
		m_free(state);
		state = state_tmp;
#endif

		i = i + blocksize;
