Edits to everything.

Fixed the checknetwork option and a lot of changes to the top variable part of the script.