Changed code to allow multiple network levels.