In this script, when a game is killed it deletes the info so that the game can then again be spawned on a different port. But for some reason, it deletes the wrong info. I dont understand what is wrong with it, can someone help me out.

Code:
on *:text:*kill*:#winbolo:{
  if ($1 == $me) {
    var %killport = $3
    if (%killport isin %used.ports) {
      var %nick2 = $findtok(%used.ports , $wildtok(%used.ports, * $+ %kill.port , 1, 44), 1, 44)
      var %nick1 = $gettok(%used.ports,%nick2,44)
      var %nick = $gettok(%nick1,1,46)
      if ((($nick == %nick) || ($nick isop #winbolo) || ($nick == %owner))) {
        var %nick2 = $findtok(%used.ports , $wildtok(%used.ports, * $+ %kill.port , 1, 44), 1, 44)
        set %used.ports $deltok(%used.ports, $calc(%nick2 + 1), 44)
        /run $mircdir $+ wonkaDSctl.exe quit $3
        msg #winbolo Bang! $nick has just killed game on port $3 
      }
      else msg #winbolo Sorry, only the person that started the game, the bot owner or an op may kill that game.
    }
  }
}


%used.ports in the script would look like this

%used.ports ,harl.27500,harl.27501