hash func improved