anchor.diff:              pos = pos+1
           end if
       end do
  +    sumWeights = sum(B(:,2))
  +    sumWeights_inv = 1.d0/sumWeights
   end subroutine subsetPeriod
   
   end module smearingmodule
  
positive.code:     double precision, dimension(i)                      :: epredC, epredT, diff, A1, A2
      double precision, dimension(i,i)                    :: B1, B2
      integer                                             :: j, Period, jj
      double precision                                    :: sumWeights, sumWeights_inv
  
      diff = 0.0d0
      wm = 0.0d0
  
negative.code: 
      do jj =1, nPeriods
          ALLOCATE(out(nPeriodT(jj),7))
          CALL subsetPeriod(bigDF, i, 8, nPeriodT(jj), jj, out, sumWeights_inv) !Filters data
          !sumWeights = sum(out(:,2))
          !sumWeights_inv = 1.d0/sumWeights
          do j=1, nPeriodT(jj)
              wm(jj) = wm(jj) + (out(j,7)*out(j,2)*sumWeights_inv)
          end do
  