selects highest ranking player

picks highest ranking player if the given unit is null, added spacing for readability