Added keys_to_output to network.py