Create globals and shell encoding function