should use cmp to compare keys