added mergeKeys method