moved to hash func