Updated "func" to "function" in Network.connect.

- Renamed the "func" parameter to "function" for clairity.
- Moved the pre-node get routine before it is used