diff --git a/source/f90/doeels.f90 b/source/f90/doeels.f90
index 829415cc628348b473e08733354cf50f0ad683b0..677c81be565ee9c80a667072b7a00d9301984fd7 100644
--- a/source/f90/doeels.f90
+++ b/source/f90/doeels.f90
@@ -204,7 +204,18 @@ subroutine doeels (e0, theta, phia, phib, wmin, wmax, dw, comment, comment_size,
     wn = wmin + (iw - 1) * dw
 !    if (debug) write (*,*) 'wn: ', wn
     if (wn >= 0.0d0) then
-q
+      if (wn /= 0.0d0) then
+        if (.not. user) call seteps(neps, nos, oscType, osc, epsinf, wn, eps, layers)
+
+        x = wn / (2 * ener * psia)
+        if (rational) then
+          f = qrat(x, alpha, beta, c1, c2) * dimag(-2 / (1.0d0 + eps(1)))
+        else
+          call queels(x, f, aerr, rerr, facru, eps, thick, layers, nper)
+        endif
+        f = prefac * f / wn
+      endif ! wn /= 0.0d0
+
       wn_array(iw) = wn
       f_array(iw)  = f