Totally changed the structure so that we are grouping the lines by the server they refer to before we try o contact any servers.