Updated C++ version of terminal application.