Updated with SDRAM additions (pre_c and terminate)