Just something I fond for getting the keys from counter

Just a small bit of code I found which can probably be used for
extracting the states automatically from Guangliangs counter of all the
data... It's commented out