modularized myTerminal2.c