diff --git a/cmake/compiler.cmake b/cmake/compiler.cmake
index 193ceb572de0aaa41d93d0bdb9672a66ecf3e2ad..875eb56cbd2931cdbaacd9f0e6c9394f8fe38f58 100644
--- a/cmake/compiler.cmake
+++ b/cmake/compiler.cmake
@@ -73,6 +73,9 @@ get_filename_component (Fortran_COMPILER_NAME ${CMAKE_Fortran_COMPILER} NAME)
 if (Fortran_COMPILER_NAME MATCHES "gfortran.*")
 
   set (gfortran_EXTRA_FLAGS "-fomit-frame-pointer -fno-automatic -fno-second-underscore -ffixed-line-length-none -fno-range-check")
+  if (${CMAKE_Fortran_COMPILER_VERSION} VERSION_GREATER 10.0.0)
+     set (gfortran_EXTRA_FLAGS "${gfortran_EXTRA_FLAGS} -fallow-argument-mismatch -fallow-invalid-boz")
+  endif()
   set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${gfortran_EXTRA_FLAGS}")
   set (CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} ${gfortran_EXTRA_FLAGS}")
   set (CMAKE_Fortran_FLAGS_DEBUG   "${CMAKE_Fortran_FLAGS_DEBUG} ${gfortran_EXTRA_FLAGS}")
diff --git a/nanocernlib b/nanocernlib
index 13987d3179c837fd1e8a1c3e40848b8b31085fe5..cee0741e7008ac46bc4ce5ded570735894efa00a 160000
--- a/nanocernlib
+++ b/nanocernlib
@@ -1 +1 @@
-Subproject commit 13987d3179c837fd1e8a1c3e40848b8b31085fe5
+Subproject commit cee0741e7008ac46bc4ce5ded570735894efa00a
diff --git a/simc/compiler.cmake b/simc/compiler.cmake
index 65606517312bd3ff2f8cb4862db51878e32cb6af..50d6bded21a46fd3d49ae35cf3cf8eb24e536151 100644
--- a/simc/compiler.cmake
+++ b/simc/compiler.cmake
@@ -11,7 +11,8 @@ if (Fortran_COMPILER_NAME MATCHES "gfortran.*")
   set (CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} ${gfortran_EXTRA_FLAGS}")
   set (CMAKE_Fortran_FLAGS_DEBUG   "${CMAKE_Fortran_FLAGS_DEBUG} ${gfortran_EXTRA_FLAGS}")
   set (CMAKE_Fortran_FLAGS_RELWITHDEBINFO "${CMAKE_Fortran_FLAGS_RELWITHDEBINFO} ${gfortran_EXTRA_FLAGS}")
-
+## gcc10 optimization
+  set (gfortran_EXTRA_FLAGS "${gfortran_EXTRA_FLAGS} -fallow-argument-mismatch -fallow-invalid-boz")
 ## g77
 elseif (Fortran_COMPILER_NAME MATCHES "g77.*")
 
diff --git a/simc/constants.inc b/simc/constants.inc
index 4b358e2f6f42c02aa8a5419345bef3dc10e1ee46..bd4869930cc4cfd054242ce57dc224b18ade942b 100644
--- a/simc/constants.inc
+++ b/simc/constants.inc
@@ -9,12 +9,14 @@
 !	All roads lead to infinity
 
 ! ... some physical constants
-	real*8 Me, Me2, Mp, Mp2, Mn, Mn2, Mpi, Mpi2, Mpi0, Mpi02
+	real*8 Me, Me2, Mmu, Mmu2, Mp, Mp2, Mn, Mn2, Mpi, Mpi2, Mpi0, Mpi02
 	real*8 Mk, Mk2, Mrho, Mrho2,Md, Md2
 	real*8 Mlambda, Msigma0, Msigma_minus
 	real*8 amu, hbarc, pi, twopi, alpha, alpi, degrad, euler
 	parameter (Me=0.51099906)
 	parameter (Me2=Me**2)
+	parameter (Mmu=113.4289257)
+	parameter (Mmu2=Mmu**2)
 	parameter (Mp=938.27231)
 	parameter (Mp2=Mp**2)
 	parameter (Mn=939.56563)
diff --git a/simc/dbase.f b/simc/dbase.f
index fd841127995a60a4da10a35d857ce08067ff9a27..b100a12f6ee04957be0576a1e875a6dd1342e203 100644
--- a/simc/dbase.f
+++ b/simc/dbase.f
@@ -193,6 +193,9 @@ C DJG:
         else if (doing_positron) then
 	   Mh = Me
 	   doing_eep=.false.
+        else if (doing_muons) then
+	   Mh = Mmu
+	   doing_eep=.false.
 	else		!doing_eep if nothing else set.
 	  Mh=Mp
 	  doing_eep = .true.
@@ -304,7 +307,7 @@ C DJG:
 	      sign_hadron=-1.0
 	   endif
 
-	else if(doing_positron) then
+	else if(doing_positron.or.doing_muons) then
 	   targ%Mtar_struck = Mp
 	   targ%Mrec_struck = Mp
 
@@ -776,6 +779,8 @@ C DJG:
 	   endif
 	else if (doing_positron) then
 	  write(6,*) ' ****--------  Doing positron  --------****'
+	else if (doing_muons) then
+	  write(6,*) ' ****--------  Doing muon  --------****'
 	else if (doing_phsp) then
 	  write(6,*) ' ****--------  PHASE SPACE - NO physics, NO radiation  --------****'
 	else
@@ -894,6 +899,7 @@ C DJG:
 	ierr = regparmint('doing_2pi',doing_2pi,0)
 	ierr = regparmint('doing_rho',doing_rho,0)
 	ierr = regparmint('doing_positron',doing_positron,0)
+	ierr = regparmint('doing_muons',doing_muons,0)
 	ierr = regparmint('doing_decay',doing_decay,0)
 	ierr = regparmdouble('ctau',ctau,0)
 
diff --git a/simc/simc.f b/simc/simc.f
index 08dbbb37806ba6d09784cc0c8545dab74519f401..371c81fc7d36735c4d4af2a45ec192095a117038 100644
--- a/simc/simc.f
+++ b/simc/simc.f
@@ -795,6 +795,8 @@ c	  write(7,*) 'BP thingie in/out     ',shmsSTOP_BP_in,shmsSTOP_BP_out
 	  write(iun,*) '              ****--- PHASE SPACE - NO physics, NO radiation (may not work)---****'
 	else if (doing_positron) then
 	  write(iun,*) '              ****--- doing positron****'
+	else if (doing_muons) then
+	  write(iun,*) '              ****--- doing muons****'
 	else
 	  stop 'I don''t have ANY idea what we''re doing!!!'
 	endif
diff --git a/simc/simulate.inc b/simc/simulate.inc
index 87894005dc86430089d84426b16909fbfd869a40..169a0aa5ad9627893140009757253269a9dbc3fa 100644
--- a/simc/simulate.inc
+++ b/simc/simulate.inc
@@ -68,8 +68,8 @@
 	logical doing_hyd_elast, doing_deuterium, doing_heavy
 	logical doing_eep, doing_pion, doing_delta, doing_2pi, doing_kaon, doing_rho
 	logical doing_semi, doing_semipi, doing_semika, doing_hplus
-	logical doing_positron
-	integer*4 which_kaon, which_pion
+	logical doing_positron, doing_muons
+	integer*4 padding, which_kaon, which_pion
 	logical using_cit_generation, using_Coulomb, using_Eloss
 	logical correct_Eloss, correct_raster,do_fermi
 	logical using_tgt_field
@@ -92,10 +92,11 @@
      >    extra_dbase_file,tgt_field_file,using_E_arm_montecarlo,using_P_arm_montecarlo,
      >    doing_phsp, using_rad, hard_cuts, doing_hyd_elast, doing_deuterium, doing_heavy,
      >    doing_eep, doing_pion, doing_delta, doing_2pi, doing_kaon, doing_rho, doing_semi,doing_positron,
+     >    doing_muons, 
      >    doing_semipi, doing_semika, doing_hplus, which_kaon,
      >    which_pion, using_cit_generation, using_Coulomb, using_Eloss,
      >    correct_Eloss, correct_raster, do_fermi,using_tgt_field,
-     >    electron_arm, hadron_arm, use_first_cer,
+     >    electron_arm, hadron_arm, use_first_cer, padding,
      >    transparency, use_benhar_sf, random_state_file, random_seed
 
 ! ........ note: make these first two parameters at least ONE BIGGER than the actual dimensions you want to read in