diff --git a/TZPGcalc.py b/TZPGcalc.py
index 4b0688fd180d8a5e692c7e4a6d426e5e939d6dd8..27782c791e14ad61d7a483f87b055b2baf3f30c0 100644
--- a/TZPGcalc.py
+++ b/TZPGcalc.py
@@ -17,7 +17,7 @@ from ipywidgets import HBox, VBox, Layout
 from IPython.display import display
 
 # zone plate focal length
-F = 250*1e-3 # [m]
+F0 = 250*1e-3 # [m]
 
 # Z position of the zone plate optic from the first interaction point (sample Z stage at 0 mm)
 Z0 = 230*1e-3 # [m]
@@ -25,7 +25,7 @@ Z0 = 230*1e-3 # [m]
 # zone plate nominal focal sorthened by the KBS focusing
 d = 3.3 - Z0 # distance between HFM and TZPG
 f1 = 7.3 # HFM focus 2 m behind second interaction point
-F = F*(d-f1)/(d-f1-F)
+F = F0*(d-f1)/(d-f1-F0)
 KBS_F = f1 - d # KBS focus distance from TZPG
 
 # number of membrane to show
@@ -363,14 +363,18 @@ class TZPGcalc():
         self.d_label.value = f'Grating Pitch:{int(np.round(d_nominal*1e9))} nm'
 
         rn = TZPGwV + TZPGo
-        dr_nominal = wl * F / (2*rn)
+        dr_nominal = wl * F0 / (2*np.sqrt(rn**2 + (TZPGwV/2)**2))
         self.dr_label.value = f'Outer Zone Plate width dr:{int(np.round(dr_nominal*1e9))} nm'
 
         # configuration for the low energy and high energy photon
-        confL = {'F':(2*rn)*dr_nominal/wlL,
+        F0_temp = (2*np.sqrt(rn**2 + (TZPGwV/2)**2))*dr_nominal/wlL
+        F_temp = F0_temp*(d-f1)/(d-f1-F0_temp)
+        confL = {'F':F_temp,
                  'theta_grating':np.arcsin(wlL/d_nominal),
                  'TZPGwH':TZPGwH, 'TZPGwV':TZPGwV,  'TZPGo':TZPGo}
-        confH = {'F':(2*rn)*dr_nominal/wlH,
+        F0_temp = (2*np.sqrt(rn**2 + (TZPGwV/2)**2))*dr_nominal/wlH
+        F_temp = F0_temp*(d-f1)/(d-f1-F0_temp)
+        confH = {'F':F_temp,
                  'theta_grating':np.arcsin(wlH/d_nominal),
                  'TZPGwH':TZPGwH, 'TZPGwV':TZPGwV,  'TZPGo':TZPGo}