added stack and intermediary code definitions