diff --git a/xfibres_gpu.cc b/xfibres_gpu.cc
index 2b0622aedf3f80e1505d221dcaaaafdfcad2df97..717e1838de675b7d79c02d7fe38d77c12df680c2 100644
--- a/xfibres_gpu.cc
+++ b/xfibres_gpu.cc
@@ -108,12 +108,12 @@ int main(int argc, char *argv[]){
 
 	if(last_sub_part<(SIZE_SUB_PART*0.5)){ 	//if is too small the last part we distribute it between the others
 		if(nsubparts-1){
-			size_sub_partLR = size_sub_partLR + last_sub_partLR/(nsubparts-1);
+			size_sub_part = size_sub_part + last_sub_part/(nsubparts-1);
 			nsubparts--;
 		}else{
-			size_sub_partLR = 0;
+			size_sub_part = 0;
 		}
-		last_sub_partLR = size_partLR - ((nsubparts-1)*size_sub_partLR);
+		last_sub_part = size_part - ((nsubparts-1)*size_sub_part);
 	}
 
 	Matrix mydatam_part;