edit rehash function