added rehashing method