merged hash functions needed for write