Insert beginRun and buildStructure()