Refine hash creation process, add tiebreaker