Changed method of resetting counter
Mode reversal