moved the network and cluster generation to be done within threads