   Serial.print("signal strength (RSSI):");
   Serial.print(rssi);
   Serial.println(" dBm");
+
+  Serial.flush();
 }
 
 void softReset() {

  Serial.begin(9600);
  Serial.println("Starting up.");
  setupWifi();
  Serial.println("wifi should be setup!");

  pseudopod = new Pseudopod(conn, conn);
}


  Serial.println(" bytes free");
  Serial.flush();
  delay(2000);
}

void connectToServer() {
  Serial.println("Connecting to the server.");
  Serial.flush();
  while(!conn.connect(server, port)) {
    Serial.println("Can't connect to the server.");
    Serial.flush();
    conn.stop();
    delay(1000);     
  }
}

void setupWifi() {
  int status = WL_IDLE_STATUS;

  while (status != WL_CONNECTED) {
    Serial.print("Attempting to connect to SSID: ");
    Serial.println(ssid);
    Serial.flush();
    status = WiFi.begin(ssid, password);
  }

  // print the SSID of the network you're attached to:
  Serial.print("SSID: ");
  Serial.println(WiFi.SSID());
