modified networks.py