added random sampling of hash functions