added some features to counting and fixed capitalization bug in counter keys