Moved root check section up, since global var section was using sudo for stuff