working on terms and tokens in leveldb