Thanku jamie and raw, this much works
Jamie i used your code
I want to add little more complex thing to the code
What should i edit if i want that the addition takes place, only when a certain value is increased.
For example: 5 is only added when value of x(kind of index) increases to 2 from 1 till s1.count, and it should add to values only to index which are after value of x