Terminal implementation (not yet finished)