replace quick and dirty hash