The position of inversion depends on two variables, ASTART and AEND.
They are assigned values of 5 and 10.
On 1st run code works fine and inversion starts at 5th char and ends on 10th.
But after power off and back on, seems like these two variables are not same any more.