Make getnetwork.m much more powerful, need test.