YJ- updated hash functions