Actually i solved it.But here my question is where did countdownIndex is decreased by 1 value for each cycle.Actually theres the if condition for countdownIndex that works only if countdownIndex is zero otherwise it will be same value or in that condition only it always decreases its value.pls clear my vision thanks in advance!!!