fixed terminal bug, and added to CFG datastructire