diff --git a/recursive_gmconvert.sh b/recursive_gmconvert.sh
index 498dae8f7230f077dcc8341ecf9bd264cb1f0da4..0b377115e1fa8fc5fc614605d08d3d8e6513c2aa 100755
--- a/recursive_gmconvert.sh
+++ b/recursive_gmconvert.sh
@@ -50,6 +50,11 @@ then
 	exit 1
 fi
 
+if [[ -z "$n_gaussians0" ]]
+then
+	n_gaussians0=$n_gaussians
+fi
+
 MaxArraySize=100000
 get_max_jobs(){
 	echo ${MaxArraySize}
@@ -70,6 +75,7 @@ cd $map_root_dir
 mkdir -p converged
 for ((i=$i0 ; i<=N ; i++))
 do
+	echo "i=$i"
 	n=$((i))
 	jobname=${map_name}_${n}
 
@@ -91,8 +97,8 @@ do
 			n_jobs=$((n_jobs + $(awk '/NGAUSS/{s+=$3}END{print s}' ${gmm_file}) ))
 		done
 		echo echo ${gmm_name} '$((SLURM_ARRAY_TASK_ID-1+offset))' \> 'tmp_$((SLURM_ARRAY_TASK_ID+offset)).txt'  
-		echo ${profile_cmd} ${gmconvert} -imap ${map_name}  -gmml 'tmp_$((SLURM_ARRAY_TASK_ID+offset)).txt' -oimap $n/'sub_$((SLURM_ARRAY_TASK_ID+offset-1)).mrc' -ogmm $n/${n}_'$((SLURM_ARRAY_TASK_ID-1+offset))'.gmm -ng ${n_gaussians} -zth ${threshold}
-		echo ${gmconvert}  -igmm $n/${n}_'$((SLURM_ARRAY_TASK_ID-1+offset)).gmm' -imap $n/'sub_$((SLURM_ARRAY_TASK_ID+offset-1)).mrc' -omap /dev/null
+		echo ${profile_cmd} ${gmconvert} -imap ${map_name}  -gmml 'tmp_$((SLURM_ARRAY_TASK_ID+offset)).txt' -ogmm $n/${n}_'$((SLURM_ARRAY_TASK_ID-1+offset))'.gmm -ng ${n_gaussians} -zth ${threshold}
+		echo ${gmconvert}  -igmm $n/${n}_'$((SLURM_ARRAY_TASK_ID-1+offset)).gmm' -imap ${map_name}  -gmml 'tmp_$((SLURM_ARRAY_TASK_ID+offset)).txt' -omap /dev/null
 	fi > commands_$i.sh
 	mkdir -p $n
 	max_jobs=$(get_max_jobs)