anchor.diff:     ! Root displacements
      x%q(1:3) = u%RootMotion%TranslationDisp(1:3,1)
      ! Root rotations
  -   CALL BD_CrvExtractCrv(u%RootMotion%Orientation(1:3,1:3,1),x%q(4:6),ErrStat2,ErrMsg2)
  +   CALL BD_CrvExtractCrv(u%RootMotion%Orientation(1:3,1:3,1),temp3,ErrStat2,ErrMsg2)
         CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )
      CALL BD_CrvExtractCrv(p%GlbRot,temp_glb,ErrStat2,ErrMsg2)
         CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )
      temp_cc(:) = MATMUL(p%GlbRot,p%uuN0(4:6,1))
  -   CALL BD_CrvCompose(temp_cc,temp_cc,temp_glb,0,ErrStat2,ErrMsg2)
  -      CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )
  -   CALL BD_CrvCompose(x%q(4:6),x%q(4:6),temp_cc,2,ErrStat2,ErrMsg2)
  +   CALL BD_CrvCompose(temp_ref,temp_cc,temp_glb,0,ErrStat2,ErrMsg2)
  +      CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )
  +   CALL BD_CrvCompose(temp_root,temp_cc,temp3,0,ErrStat2,ErrMsg2)
  +      CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )
  +!WRITE(*,*) 'temp_u0'
  +!WRITE(*,*) temp_cc
  +!WRITE(*,*) 'temp_glb'
  +!WRITE(*,*) temp_glb
  +!WRITE(*,*) 'temp_ori'
  +!WRITE(*,*) temp3
  +!WRITE(*,*) 'temp_ref'
  +!WRITE(*,*) temp_ref
  +!WRITE(*,*) 'temp_root'
  +!WRITE(*,*) temp_root
  +   CALL BD_CrvCompose(x%q(4:6),temp_root,temp_ref,2,ErrStat2,ErrMsg2)
         CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName )
      x%q(4:6) = MATMUL(TRANSPOSE(p%GlbRot),x%q(4:6))
      ! Root velocities/angular velocities and accelerations/angular accelerations
  
positive.code:            ! Step 2: Compose step1 with rotation vector from p%GlbRot
             ! Initial position (undeformed) rotation vector in global frame obtained
             ! R_0^{T} in global frame
             CALL BD_CrvCompose(temp_p0,temp_p0,temp_glb,0,ErrStat2,ErrMsg2)
             temp_id = ((i-1)*(p%node_elem-1)+j-1)*p%dof_node
             ! Step 3: R = R_{ini} R_0^{T}
             CALL BD_CrvCompose(x%q(temp_id+4:temp_id+6),temp3,temp_p0,2,ErrStat2,ErrMsg2)
             ! Step 4: Rotate rotation parameter (displacement) from global frame to blade frame
             x%q(temp_id+4:temp_id+6) = MATMUL(TRANSPOSE(p%GlbRot),x%q(temp_id+4:temp_id+6))
         ENDDO
  
negative.code: 
     call BD_Input_extrapinterp( u, utimes, u_interp, t+p%dt, ErrStat2, ErrMsg2 )
        call SetErrStat(ErrStat2,ErrMsg2,ErrStat,ErrMsg,RoutineName)
  !WRITE(*,*) 'u_interp'
  !DO i=1,3
  !WRITE(*,*) u_interp%RootMotion%Orientation(i,:,1)
  !ENDDO
  !WRITE(*,*) 'END u_interp'
                   
     ! GA2: prediction        
     CALL BD_TiSchmPredictorStep( x_tmp%q,x_tmp%dqdt,OS_tmp%acc,OS_tmp%xcc,             &
                                  p%coef,p%dt,x%q,x%dqdt,OtherState%acc,OtherState%xcc, &
  