Initial substitutions code, intended for use with advanced generators.