Needs testing.
Forgot the counter stuff.
Merge
Counter creation works.
Fixed counter.