New code for Terminal