fixes to counter code (both counter and counter2)- LG
changes to vars - LG