diff --git a/src/data/macros.h b/src/data/macros.h
index 3128e740664613316237119124a2dbdb36429e91..20555bca1a7a67572956647490ebced1ab3e8eba 100644
--- a/src/data/macros.h
+++ b/src/data/macros.h
@@ -44,13 +44,4 @@
     fclose(fd__);                                                                                                                \
   }
 
-/*! \brief A wrapper for the printf() function
- *
- *  This macro has the same functionalities of the standard printf()
- *  function. However, data is written to the standard output only for
- *  the task with rank 0
- *
- *  \param fmt string that contains format arguments
- */
-
 #endif
diff --git a/src/data/simparticles.h b/src/data/simparticles.h
index 7a6ad8dc6d8b40c9d9215b6f02a2ff34be5465b9..6b4f2279bdbfa4b79baff00af79a2f985d21ce68 100644
--- a/src/data/simparticles.h
+++ b/src/data/simparticles.h
@@ -317,23 +317,20 @@ class simparticles : public intposconvert, public setcomm
    */
   void dump_particles(void)
   {
-    /*
     FILE *fd;
     char buffer[200];
     sprintf(buffer, "particles_%d.dat", ThisTask);
     if((fd = fopen(buffer, "w")))
       {
-        my_fwrite(&NumPart, 1, sizeof(int), fd);
+        fwrite(&NumPart, 1, sizeof(int), fd);
         for(int i = 0; i < NumPart; i++)
-          my_fwrite(&P[i].IntPos[0], 3, sizeof(MyIntPosType), fd);
+          fwrite(&P[i].IntPos[0], 3, sizeof(MyIntPosType), fd);
         for(int i = 0; i < NumPart; i++)
-          my_fwrite(&P[i].Vel[0], 3, sizeof(MyFloat), fd);
+          fwrite(&P[i].Vel[0], 3, sizeof(MyFloat), fd);
         for(int i = 0; i < NumPart; i++)
-          my_fwrite(&P[i].ID, 1, sizeof(int), fd);
+          fwrite(&P[i].ID, 1, sizeof(MyIDStorage), fd);
         fclose(fd);
       }
-
-      */
   }
 
   /** \brief Print information relative to a particle / cell to standard output.
diff --git a/src/domain/domain_balance.cc b/src/domain/domain_balance.cc
index b769ba77f04e10d0301f9bd7a4c573758bfb287e..3a14d4970c64c5be0fa619cdd9b0d8a15e605317 100644
--- a/src/domain/domain_balance.cc
+++ b/src/domain/domain_balance.cc
@@ -717,33 +717,11 @@ void domain<simparticles>::domain_init_sum_cost(void)
 
 #if defined(LIGHTCONE) && defined(LIGHTCONE_PARTICLES)
 
-/*
-template <>
-double domain<lcparticles>::domain_grav_tot_costfactor(int i)
-{
-  return 1.0;
-}
-
-template <>
-double domain<lcparticles>::domain_hydro_tot_costfactor(int i)
-{
-  return 0;
-}
-*/
-/*
-template <>
-void domain<lcparticles>::domain_combine_multipledomains(void)
-{
-}
-*/
-
 template <>
 void domain<lcparticles>::domain_init_sum_cost(void)
 {
   for(int i = 0; i < TIMEBINS; i++)
     {
-      //   domain_bintolevel[i]     = -1;
-      //   domain_refbin[i]         = -1;
       domain_to_be_balanced[i] = 0;
       domain_grav_weight[i]    = 1;
       domain_hydro_weight[i]   = 1;
diff --git a/src/domain/domain_exchange.cc b/src/domain/domain_exchange.cc
index 69d7c01a2fea7558f44cf61c9129d2e57b62d015..d0427a941bcd6f947aebb93c48c02adc71613e3b 100644
--- a/src/domain/domain_exchange.cc
+++ b/src/domain/domain_exchange.cc
@@ -54,10 +54,6 @@ void domain<partset>::domain_resize_storage(int count_get_total, int count_get_s
       int maxpartsphNew = max_sphload / (1.0 - 2 * ALLOC_TOLERANCE);
       if(option_flag == 2)
         {
-          /*
-          if(maxpartsphNew > NgbTree.MaxPart)
-            ngb_treemodifylength(maxpartsphNew - NgbTree.MaxPart);
-          */
           Terminate("need to reactivate this");
         }
       Tp->reallocate_memory_maxpartsph(maxpartsphNew);
@@ -80,9 +76,6 @@ void domain<partset>::domain_countToGo(int *toGoDM, int *toGoSph)
     {
       int no = n_to_no(n);
 
-      // FIXME: Why is this check to stay on local domain disabled?
-      //        if(TaskOfLeaf[no] != ThisTask)
-
       if(Tp->P[n].getType() == 0)
         toGoSph[TaskOfLeaf[no]]++;
       else
diff --git a/src/domain/domain_toplevel.cc b/src/domain/domain_toplevel.cc
index 062b8f4c330e78fc49260fd5d673ac013a33e577..2dcb292910a3f850bd6dfdb735f3194d1b2ca50a 100644
--- a/src/domain/domain_toplevel.cc
+++ b/src/domain/domain_toplevel.cc
@@ -83,13 +83,8 @@ void domain<partset>::domain_do_local_refine(int n, int *list)
 
   allreduce_sum<double>(worklist, 8 * n, Communicator);
   allreduce_sum<long long>(countlist, 8 * n, Communicator);
-  /*
-  MPI_Allreduce(MPI_IN_PLACE, worklist, 8 * n, MPI_DOUBLE, MPI_SUM, Communicator);
-  MPI_Allreduce(MPI_IN_PLACE, countlist, 8 * n, MPI_LONG_LONG, MPI_SUM, Communicator);
-*/
 
   /* store the results in the corresponding top nodes */
-
   for(int k = 0; k < n; k++)
     {
       int i = list[k];
diff --git a/src/io/io.h b/src/io/io.h
index fdc2bd8122e73a18af536b4efa6d01aedcca4acc..0390074958d2be931c49a4f161721e0e3daac653 100644
--- a/src/io/io.h
+++ b/src/io/io.h
@@ -271,14 +271,4 @@ class IO_Def : public io_streamcount, public setcomm
 #define FLAG_ZELDOVICH_ICS 1
 #define FLAG_SECOND_ORDER_ICS 2
 
-/* functions visible in the whole code */
-
-/*
-
-  void test_io_bandwidth(void);
-  void dump_particles(void);
-
-
-*/
-
 #endif
diff --git a/src/lightcone/lightcone_massmap_io.h b/src/lightcone/lightcone_massmap_io.h
index b0cecc1702295834e3513eafa0b556b2645d1aee..2d170c72bfb1fdc3e868b362316c481cab98bf39 100644
--- a/src/lightcone/lightcone_massmap_io.h
+++ b/src/lightcone/lightcone_massmap_io.h
@@ -62,10 +62,6 @@ class lightcone_massmap_io : public IO_Def
   lightcone *LightCone;
 
   int selected_bnd;
-
-  /*
-   * special input/output functions for certain fields
-   */
 };
 
 #endif
diff --git a/src/mergertree/io_halotrees.cc b/src/mergertree/io_halotrees.cc
index 06bc6c22609a538f09a59e839ccb8e8da3befcf8..1de1ecfd168f010d5ea08c4381cd9d71afddbf56 100644
--- a/src/mergertree/io_halotrees.cc
+++ b/src/mergertree/io_halotrees.cc
@@ -121,18 +121,6 @@ halotrees_io::halotrees_io(mergertree *MergerTree_ptr, MPI_Comm comm, int format
   init_field("TRIX", "TreeIndex", MEM_INT, FILE_INT, SKIP_ON_READ, 1, A_H, &MergerTree->Halos[0].TreeIndex, NULL, TREEHALOS, 0, 0, 0,
              0, 0, 0, 0, true);
 
-  /* we don't need to store the links in terms of the global subhalo numbers for full timeslices */
-  /*
-  init_field("UGRN", "UniqueGroupNr", MEM_INT64, FILE_INT64, SKIP_ON_READ, 1, A_H, &MergerTree->Halos[0].UniqueGroupNr, NULL,
-             TREEHALOS, 0, 0, 0, 0, 0, 0, 0);
-  init_field("DESC", "DescSubhaloNr", MEM_INT64, FILE_INT64, SKIP_ON_READ, 1, A_H, &MergerTree->Halos[0].DescSubhaloNr, NULL,
-             TREEHALOS, 0, 0, 0, 0, 0, 0, 0);
-  init_field("NEXT", "NextProgSubhaloNr", MEM_INT64, FILE_INT64, SKIP_ON_READ, 1, A_H, &MergerTree->Halos[0].NextProgSubhaloNr, NULL,
-             TREEHALOS, 0, 0, 0, 0, 0, 0, 0);
-  init_field("FRST", "FirstProgSubhaloNr", MEM_INT64, FILE_INT64, SKIP_ON_READ, 1, A_H, &MergerTree->Halos[0].FirstProgSubhaloNr, NULL,
-             TREEHALOS, 0, 0, 0, 0, 0, 0, 0);
-*/
-
   /**** output times */
 
   init_field("REDS", "Redshift", MEM_DOUBLE, FILE_DOUBLE, SKIP_ON_READ, 1, A_CT, &MergerTree->CatTimes[0].Redshift, NULL, TREETIMES, 0,
diff --git a/src/mergertree/mergertree.h b/src/mergertree/mergertree.h
index 8ebda0653eebf013601384c163fe988fb540c70c..86f3cefe42bcd4ec4fd0c2484383eec6c1a8dcce 100644
--- a/src/mergertree/mergertree.h
+++ b/src/mergertree/mergertree.h
@@ -565,10 +565,5 @@ class mergertree : public setcomm
   void halotrees_select_interior_min_newtreeid(int mode, tlink *treehalos, long long totnsubs);
 };
 
-/* In the following structure, we accumulate the main result of this routine, namely for each previous
- * subhalo (identified through PrevSubhaloNr), the number of the descendant subhalo (DescSubhaloNr) in
- * the present, newly calculated subhalo catalogue. MaxScore is a helper variable that gives the score
- * of the presently associated descendant. If there is no descendant, DescSubhaloNr has the value -1 (check). */
-
 #endif
 #endif
diff --git a/src/mpi_utils/generic_comm.h b/src/mpi_utils/generic_comm.h
index cc500ce5ea039622e9dc233820a949c691adcf9d..9fe6846b34eb81bdfd650e5386a1801b4a7634d8 100644
--- a/src/mpi_utils/generic_comm.h
+++ b/src/mpi_utils/generic_comm.h
@@ -217,11 +217,6 @@ class generic_comm
 
     sprintf(callorigin, "%s|%d|", file, line);
 
-    /*
-     mpi_printf("GENERIC: file %s, line %d: MinSpace = %g MB  NTopleaves = %d  ExportSpace = %g MB\n", file, line,
-     MinSpace / (1024.0 * 1024.0), D->NTopleaves, ExportSpace / (1024.0 * 1024.0));
-     */
-
     if(ExportSpace < MinSpace)
       {
         Mem.dump_memory_table();
@@ -248,8 +243,7 @@ class generic_comm
 
     Thread.PartList = (data_partlist *)Mem.mymalloc_movable_g(&Thread.PartList, "PartList", ExportSpace);
     /* note: the NodeList array will be attached to the end of this buffer, growing backwards */
-    /* Thread[i].NodeList = (data_nodelist *) (((char *) Thread[i].PartList) + InitialSpace);
-     */
+
     Thread.Ngblist     = (int *)Mem.mymalloc_movable_g(&Thread.Ngblist, "Ngblist", Tp->NumPart * sizeof(int));
     Thread.Shmranklist = (int *)Mem.mymalloc_movable_g(&Thread.Shmranklist, "Shmranklist", Tp->NumPart * sizeof(int));
     Thread.Exportflag  = Exportflag;
diff --git a/src/mpi_utils/healthtest.cc b/src/mpi_utils/healthtest.cc
index bd2a2f88404872da1f0f99adc989ceb46a196975..52283a471d361722f4097de383e6fdb9e472274c 100644
--- a/src/mpi_utils/healthtest.cc
+++ b/src/mpi_utils/healthtest.cc
@@ -154,18 +154,11 @@ double sim::measure_cpu_performance(MPI_Comm Communicator)
 
       MPI_Barrier(Communicator);
 
-      /*
-      mpi_printf(
-          "\n\nHEALTHTEST: We are stopping because the performance variation=%g of the CPUs lies above the prescribed tolerance "
-          "MAX_VARIATION_TOLERANCE=%g, possibly indicating a machine problem. (sum=%g)\n",
-          variation, MAX_VARIATION_TOLERANCE, sum);
-       */
+      // only issue a warning for now instead of terminating the code
       warn(
           "\n\nHEALTHTEST: We issue a warning because the performance variation=%g of the CPUs lies above the prescribed tolerance "
           "MAX_VARIATION_TOLERANCE=%g, possibly indicating a machine problem. (sum=%g)\n",
           variation, MAX_VARIATION_TOLERANCE, sum);
-
-      // endrun();    // only issue a warning for now
     }
 
   return sum;
diff --git a/src/mpi_utils/sizelimited_sendrecv.cc b/src/mpi_utils/sizelimited_sendrecv.cc
index acc163df42077b01b41d26941542b836e952b779..b0ed42a35a589a8e8f9a2150e40f477f568320e3 100644
--- a/src/mpi_utils/sizelimited_sendrecv.cc
+++ b/src/mpi_utils/sizelimited_sendrecv.cc
@@ -50,13 +50,7 @@ int myMPI_Sendrecv(void *sendb, size_t sendcount, MPI_Datatype sendtype, int des
       if(sendcount > count_limit)
         {
           send_now = count_limit;
-          /*
-             if(iter == 0)
-             {
-             printf("Imposing size limit on MPI_Sendrecv() on task=%d (send of size=%lld)\n", ThisTask, (long long) sendcount *
-             size_sendtype); myflush(stdout);
-             }
-           */
+
           iter++;
         }
       else
diff --git a/src/sort/cxxsort.h b/src/sort/cxxsort.h
index 72416e5ea2140c06aa2d962862df5831f04a1c24..13d352ec429d347d32e0482e5d89c4d0dc02fae7 100644
--- a/src/sort/cxxsort.h
+++ b/src/sort/cxxsort.h
@@ -49,9 +49,6 @@ double mycxxsort(T *begin, T *end, Tcomp comp)
 
   Mem.myfree(buf);
 
-  // FIXME: verification, temporary
-  //  if (!std::is_sorted(begin,end,comp)) Terminate ("sort error!");
-
   return Logs.timediff(t0, Logs.second());
 }
 
diff --git a/src/subfind/subfind_history.cc b/src/subfind/subfind_history.cc
index 2a384b52e36b7c11c9548b4a26d32756b794aab1..571805d763bfe5b7055012c30ca723d3a72acb85 100644
--- a/src/subfind/subfind_history.cc
+++ b/src/subfind/subfind_history.cc
@@ -295,17 +295,6 @@ void fof<partset>::subfind_hbt_single_group(domain<partset> *SubDomain, domain<p
        */
       mycxxsort(all_candidates, all_candidates + totcand, subfind_hbt_compare_subcand_summedprevlen);
 
-      if(maxlen_candidate.SubhaloNr != all_candidates[totcand - 1].SubhaloNr)
-        {
-          /*
-          printf(
-              "SUBFIND_HBT:  Made a different decision on largest on task=%d:  select one with len=%lld over len=%lld because "
-              "sumprevlen=%lld is bigger than %lld\n",
-              ThisTask, (long long)all_candidates[totcand - 1].len, (long long)maxlen_candidate.len,
-              (long long)all_candidates[totcand - 1].summedprevlen, (long long)maxlen_candidate.summedprevlen);
-              */
-        }
-
       totcand--;
       for(int k = 0; k < NumPartGroup; k++)
         if(Tp->PS[IndexList[k]].SubhaloNr == all_candidates[totcand].SubhaloNr)
diff --git a/src/time_integration/timestep_treebased.cc b/src/time_integration/timestep_treebased.cc
index 03a6aa4e6f03d16f8e7d1c1f85a39a8f792cba69..6932aeffa0c6fa983190f3eb9296b997795a3468 100644
--- a/src/time_integration/timestep_treebased.cc
+++ b/src/time_integration/timestep_treebased.cc
@@ -115,24 +115,6 @@ inline int sph::sph_treetimestep_evaluate_particle_node_opening_criterion(pinfo
   if(right[2] < 0 || left[2] > 0)
     return NODE_DISCARD;
 
-  /*
-  double ctr[3];
-  Tp->intpos_to_pos(nop->center.da, ctr);
-
-  MyIntPosType halflen = ((MyIntPosType)1) << ((BITS_FOR_POSITIONS - 1) - nop->level);
-
-  vector<MyReal> dxyz;
-  Tp->nearest_image_intpos_to_pos(nop->center.da, pdat.searchcenter, dxyz.da);
-
-  double r2 = dxyz.r2();
-
-  printf("level=%d  center=(%g|%g|%g)  dist=%g lenhalf=%g   dt*vsig=%g \n ", nop->level, ctr[0], ctr[1], ctr[2], sqrt(r2),
-
-         halflen * Tp->FacIntToCoord,
-
-         SphP->CurrentMaxTiStep * vsig);
-*/
-
   return NODE_OPEN;
 }
 
diff --git a/src/tree/tree.cc b/src/tree/tree.cc
index 1d1afd7ace5f8dd33b33bb82bf84c9592ae7e890..c7be9840ef45e0aa231e4fe109aa17c5b29378aa 100644
--- a/src/tree/tree.cc
+++ b/src/tree/tree.cc
@@ -100,12 +100,7 @@ int tree<node, partset, point_data, foreign_point_data>::treebuild(int ninsert,
               if(newvalue < oldvalue)
                 {
                   treefree();
-                  /*
-                     D->mpi_printf("TREE: max_numnodes=%d  MaxNodes=%d D->NTopnodes=%d\n", max_numnodes, MaxNodes,
-                     D->NTopnodes);
-                     D->mpi_printf("TREE: Decreasing TreeAllocFactor, new value=%g, old value=%g\n", newvalue,
-                     oldvalue);
-                  */
+
                   All.TreeAllocFactor = newvalue;
                   flag                = -1;
                   treeallocate(Tp->NumPart, Tp, D);
@@ -1189,11 +1184,6 @@ void tree<node, partset, point_data, foreign_point_data>::tree_fetch_foreign_nod
                       nop->nextnode         = pfirst;
                       nop->nextnode_shmrank = Shmem.Island_ThisTask;
 
-                      //                      if(nop->cannot_be_opened_locally == 0)  // don't remove this: acts a barrier to prevent
-                      //                      the compiler from
-                      //                        Terminate("bummer");                  // reordering the store operation on
-                      //                        'cannot_be_opened_locally'
-
                       nop->cannot_be_opened_locally.store(0, std::memory_order_release);
 
                       sum_NumForeignNodes += n_nodes;
diff --git a/src/tree/tree.h b/src/tree/tree.h
index a4e03f57bea1dc546b1fbafe61f9da6934ff9774..eddc65c160b6d61b6c25e31f8cd3295b8b1e92d9 100644
--- a/src/tree/tree.h
+++ b/src/tree/tree.h
@@ -164,9 +164,6 @@ class tree
 
   int TreeInfoHandle;
 
-  /** Number of tree nodes allocated (and counted in NumNodes) but actually
-   * unused (can happen with NUM_THREADS > 1 && TAKE_NSLOTS_IN_ONE_GO > 1) */
-
   double Buildtime;
 
   int NumOnFetchStack;