diff --git a/src/improve_osolve.f90 b/src/improve_osolve.f90
index d8f6a6db2af572dd268b0651b0fdeedca8a16085..f9281dcb39cd3726482c8f4838aa8d4b24a1eca9 100644
--- a/src/improve_osolve.f90
+++ b/src/improve_osolve.f90
@@ -16,27 +16,24 @@
 !------------------------------------------------------------------------------|
 !------------------------------------------------------------------------------|
 
-subroutine improve_osolve (osolve,ov,params,threadinfo,istep,iter,total,step,   &
-                           inc,refine_level, &
-                           boxes,cube_faces,increase_current_level)
+subroutine improve_osolve (osolve,ov,params,threadinfo,istep,iter,total,step,  &
+                           inc,refine_level,boxes,cube_faces,                  &
+                           increase_current_level)
       
 !------------------------------------------------------------------------------|
 !(((((((((((((((( Purpose of the routine  ))))))))))))))))))))))))))))))))))))))
 !------------------------------------------------------------------------------|
-! this routine calculates the second invariant of the strain rate, 
-! and a value for the criterion used by the improve_octree subroutine,
-! inside each element by using the velocity information at the nodes.
-! Then, the routine improves the osolve on which the solution is calculated
-! Also, it refines the octree if the user has defined a box (or several boxes) in which the 
-! octree is artificially refined to a desired level. boxes and nboxes are read 
-! from the input file. 
+! this routine calculates the second invariant of the strain rate, and a value 
+! for the criterion used by the improve_octree subroutine, inside each element
+! by using the velocity information at the nodes. Then, the routine improves the
+! osolve on which the solution is calculated. Also, it refines the octree if the
+! user has defined a box (or several boxes) in which the octree is artificially
+! refined to a desired level. boxes and nboxes are read from the input file. 
 ! The routine then refines user supplied rectangular areas of each of the six
-! faces of the cubic simulation domain. The information are stored in 
-! cube_faces read from the input file.
-! Finally, the octree is smoothed
-! and super-smoothed if the user has set ismooth to 1
-
-
+! faces of the cubic simulation domain. The information are stored in cube_faces
+! read from the input file. Finally, the octree is smoothed and super-smoothed
+! if the user has set ismooth to 1
+!
 ! ov is the velocity octree containing the velocity solution
 ! osolve is the octree to be improved
 ! refine_ratio is a parameter read in input.txt. When multiplied by the 
@@ -151,12 +148,9 @@ do i=1+iproc,ov%nleaves,nproc
       exy=exy+(dhdx(k)*vy(k)+dhdy(k)*vx(k))/2.d0
       eyz=eyz+(dhdy(k)*vz(k)+dhdz(k)*vy(k))/2.d0
       ezx=ezx+(dhdz(k)*vx(k)+dhdx(k)*vz(k))/2.d0
-!      exy=exy+(dhdx(k)*vy(k)-dhdy(k)*vx(k))/2.d0
-!      eyz=eyz+(dhdy(k)*vz(k)-dhdz(k)*vy(k))/2.d0
-!      ezx=ezx+(dhdz(k)*vx(k)-dhdx(k)*vz(k))/2.d0
    enddo
 
-   call deviatoric (exx,eyy,ezz,exy,eyz,ezx)
+   call deviatoric (params%invariants_2d,exx,eyy,ezz,exy,eyz,ezx)
 
    E2d=second_invariant(exx,eyy,ezz,exy,eyz,ezx)
 
@@ -258,7 +252,7 @@ if (params%nboxes.gt.0) then
                if (.not.((xxx>=x0).and.(xxx<=x1) .and. &
                          (yyy>=y0).and.(yyy<=y1) .and. &
                          (zzz>=z0).and.(zzz<=z1))) call stop_run ('pb with box cloud$')
-! if (iproc.eq.0) print*,i,j,k
+               ! if (iproc.eq.0) print*,i,j,k
                call octree_create_from_particle(osolve%octree,osolve%noctree,xxx,yyy,zzz,1,level_box)
             enddo
          enddo