Added hash logic