Question about Time-weighted rate of return

HI, guys, as I studying ime-weighted rate of return, there is something I don’t understand,

An investor purchases a share of stock at t=0 for $100. At the end of year, t=1, the investor buys another share of the same stock for $120, at the end of year 2, the investor sells both shares for $130 each. At the end of both year 1 and 2, the stock paid a $2 per share dividend, what is the annual time-weighted rate of return for this investment?

step 1: Holding period 1: beginning value =$100

dividend paid =$2

ending value =$120

Holding period 2: beginning value =$240 (2 shares)

dividend paid =$4 ($2 per share)

ending value =$260 (2 shares)

My question is why the ending value of holding period 1 is 120? in my opinion, at end of year 1, the investor will have 2 shares, which values at 120*2=240, and it will equals with beginning value of holding period 2. but why it is 120? Anyone could enlighten me on this? Thanks in advance!

If you were to use $240 as the ending value of period 1, you would be treating the additional cash contributed by the investor (the $120 he spent to buy a second share) as if it were return (profit) earned in period 1.

In general, the value at the end of a period is computed before any cash is added to or taken from the investment account, and the value at the beginning of the period is computed after any cash is added to or taken from the investment account.