cool hash replacement function