Added logic to required agent to be run as root and added optional argument for port #