Added proper way of allocating NetworkIDs