implementing hash