   // attempt to connect to an open network:
   Serial.print("Attempting to connect to WEP network: ");
   Serial.println(ssid);
-  status = WiFi.begin(ssid, pass, key);
-  
+  status = WiFi.begin(ssid, keyIndex, key);
+
   // if you're not connected, stop here:
   if ( status != WL_CONNECTED) { 
     Serial.println("Couldn't get a wifi connection");

  IPAddress ip = WiFi.localIP();
  Serial.print("IP Address: ");
  Serial.println(ip);
  
  // print your MAC address:
  byte mac[6];  
  WiFi.macAddress(mac);

  } 
  // if you are connected :
  else {
    Serial.print("You're connected to the network");
    printCurrentNet();
    printWifiData();
  }
}

