Add original code for KVStore