refactored KeyIndexedCounting.py to uses offsets into strings
added comments