build module preamble - define global variables