Improved terminal example