Revert "optimise network.py"

This reverts commit 9b1880faf343df75e7ac344da7e7a5424ee741aa.