modified layers.py, networks.py