Handling separate networks. Not working yet, needs debugging.