spend balance

10 40
10 30
10 20
10 10
10 0
------------------------
50 100

now tell me how this possible

you cannot add up the amounts spent and the running balance and expect them to be equal.

Imagine that the amount spent each time is just 1. Then the right hand column will be all the numbers from 0 to 49, clearly much greater than 50.