Leader election implementation