Added new terminal code