updated for latest leveldb, merged match-map back in