Added the SUDO function and some minor changes