Replace a bunch of samples with hash and loop