Updated C++ version of terminal app.