anchor.diff:     INTEGER(IntKi),           INTENT(  OUT)   :: ErrStat     ! Error status of the operation
      CHARACTER(*),             INTENT(  OUT)   :: ErrMsg      ! Error message if ErrStat /= ErrID_None
      ! local variables
  -   REAL(ReKi)                                :: TI_transpose(nDOFL_TP,p%nDOFI__) !bjj: added this so we don't have to take the transpose 5+ times
  -   INTEGER(IntKi)                            :: I
  +   real(FEKi), allocatable                   :: Temp(:,:)
  +   real(ReKi)                                :: TI_transpose(nDOFL_TP,p%nDOFI__) !bjj: added this so we don't have to take the transpose 5+ times
  +   integer(IntKi)                            :: I
      integer(IntKi)                            :: n                          ! size of jacobian in AM2 calculation
      INTEGER(IntKi)                            :: ErrStat2
      CHARACTER(ErrMsgLen)                      :: ErrMsg2
  
positive.code:       ENDDO   
        
        ! D2_53, D2_63, D2_64 
        p%D2_63 = MATMUL( p%PhiM, p%MMB )
        p%D2_63 = p%PhiRb_TI - p%D2_63
  
        !p%D2_64 = MATMUL( p%PhiM, p%PhiM_T )
  
negative.code:       do I = 1, nM_out
           p%PhiLInvOmgL2(:,I) = PhiL(:,I)* (1./OmegaL(I)**2)
        enddo 
        ! KLL^-1 = [PhiL] x [OmegaL^2]^-1 x [PhiL]^t
        !p%KLLm1   = MATMUL(p%PhiLInvOmgL2, p%PhiL_T) ! Inverse of KLL: KLL^-1 = [PhiL] x [OmegaL^2]^-1 x [PhiL]^t
        CALL LAPACK_gemm( 'N', 'N', 1.0_ReKi, p%PhiLInvOmgL2, p%PhiL_T, 0.0_ReKi, p%KLLm1, ErrStat2, ErrMsg2); if(Failed()) return
        p%FGL     = FGL  
        p%UL_st_g = MATMUL(p%KLLm1, FGL) 
     endif     
        
     ! block element of D2 matrix (D2_21, D2_42, & part of D2_62)
  