anchor.diff:           return
         end if
   
  +   ! initialize accelerations here:
  +   if ( .not. OtherState%InitAcc) then
  +      !Qi, call something to initialize
  +      call BD_Input_extrapinterp( u, utimes, u_interp, t, ErrStat2, ErrMsg2 )
  +          call SetErrStat(ErrStat2,ErrMsg2,ErrStat,ErrMsg,RoutineName)
  +      CALL BD_InitAcc( t, u_interp, p, x_tmp, OtherState, ErrStat2, ErrMsg2)
  +          call SetErrStat(ErrStat2,ErrMsg2,ErrStat,ErrMsg,RoutineName)
  +WRITE(*,*) 'OS%Acc'
  +WRITE(*,*) OtherState%Acc(:)
  +WRITE(*,*) 'OS%Xcc'
  +WRITE(*,*) OtherState%Xcc(:)
  +      OtherState%InitAcc = .true. 
  +   end if
  +
      call BD_Input_extrapinterp( u, utimes, u_interp, t+p%dt, ErrStat2, ErrMsg2 )
         call SetErrStat(ErrStat2,ErrMsg2,ErrStat,ErrMsg,RoutineName)
   !WRITE(*,*) 'u_interp'
  
positive.code:    PUBLIC :: BD_Tilde
     PUBLIC :: BD_MotionTensor
     PUBLIC :: BD_CalcIC
     PUBLIC :: BD_IniAcc
  
  CONTAINS
  
  
negative.code:    ErrStat = ErrID_None
     ErrMsg  = ""
     
     
     
     IF(p%analysis_type == 2) THEN
  