added network testing code, should be moved to test directory later