anchor.diff:                    end if
   C                 Calculating the lifetime in the main sequence
   C                 TODO: resolve the problem with halo stars
  -                  call tsp(m(i), 
  +                  call get_main_sequence_lifetime(
  +     &                     m(i), 
        &                     metallicityOfWD(i), 
        &                     main_sequence_lifetime(i))
                     coolingTime(i) = max_age - starBirthTime(i) 
  
positive.code:           end if
  
  C         Interpolating for the value of Z, z solar 10
            t = tsub + ((tsol - tsub) / (0.01 - 0.001)) 
       &               * (metallicity - 0.001)
        end subroutine
        
  
  
negative.code:       end subroutine
  
  
        subroutine get_main_sequence_lifetime(stellar_mass, 
       &                                      metallicity,
       &                                      main_sequence_lifetime)
  C         Calculates lifetime in the main sequence for a given 
  C         metallicity Z € [0.01, 0.001] for standart helium content 
  C         according to model by Leandro & Renedo et al.(2010)
  C         Data in solar masses and Gyr
            implicit none
  
            real :: stellar_mass,
       &            metallicity,
       &            main_sequence_lifetime,
       &            mms(10),
       &            tms(10),
       &            mms2(7),
  