anchor.diff:        RETURN
      ENDIF
      
  -   Init%NNode = Init%NJoints + ( Init%NDiv - 1 )*p%NMembers    ! Calculate total number of nodes according to divisions 
  -   Init%NElem = p%NMembers*Init%NDiv                           ! Total number of element   
  -   MaxNProp   = Init%NPropSets + Init%NElem*NNE                ! Maximum possible number of property sets (temp): This is property set per element node, for all elements (bjj, added Init%NPropSets to account for possibility of entering many unused prop sets)
  -   
  -   ! Calculate total number of nodes and elements according to element types
  -   ! for 3-node or 4-node beam elements
  +   ! Total number of element   
  +   Init%NElem = p%NMembers*Init%NDiv                          
  +   ! Total number of nodes - Depends on division and number of nodes per element
  +   Init%NNode = Init%NJoints + ( Init%NDiv - 1 )*p%NMembers 
      Init%NNode = Init%NNode + (NNE - 2)*Init%NElem
      !bjj: replaced with max value instead of NNE: Init%MembersCol = Init%MembersCol + (NNE - 2) 
  +   MaxNProp   = Init%NPropSets + Init%NElem*NNE ! Maximum possible number of property sets (temp): This is property set per element node, for all elements (bjj, added Init%NPropSets to account for possibility of entering many unused prop sets)
      
      ! check the number of interior modes
      IF ( p%Nmodes > 6*(Init%NNode - Init%NInterf - p%NReact) ) THEN
  
positive.code:       ENDDO
     ENDDO
  
      ! discretize structure according to NDiv 
      knode = Init%NJoints
      kelem = 0
      kprop = Init%NPropSets
      Init%MemberNodes = 0
  
      IF (Init%NDiv > 1) THEN
         DO I = 1, p%NMembers !the first p%NMembers rows of p%Elems contain the element information
            ! create new node
            Node1 = TempMembers(I, 2)
  
negative.code:                   nprop = kprop                
               ELSE
                    kelem = kelem + 1
                    CALL SetNewElem(kelem, knode-1, knode, eType, nprop, nprop, p)                          
               ENDIF
            ENDDO
            
            ! the element connect to Node2
            kelem = kelem + 1
            CALL SetNewElem(kelem, knode, Node2, eType, nprop, Prop2, p)                
         ENDDO ! loop over all members
         !
         Init%NProp = kprop
      ENDIF ! if NDiv is greater than 1
  
      ! set the props in Init
      CALL AllocAry(Init%Props, Init%NProp, PropSetsCol,  'Init%Props', ErrStat2, ErrMsg2); CALL SetErrStat(ErrStat2,ErrMsg2,ErrStat,ErrMsg,'SD_Discrt')
      IF (ErrStat >= AbortErrLev ) THEN
         CALL CleanUp_Discrt()
         RETURN
      ENDIF
      if (Init%NDiv==1) then
         Init%Props(1:Init%NProp,1 :PropSetsCol) = Init%PropSets(1:Init%NProp, 1:PropSetsCol)
      else if (Init%NDiv>1) then
         Init%Props = TempPropsBeams(1:Init%NProp, 1:PropSetsCol)
      endif
      print*,'Init%Props'
      print*, Init%Props
  
  