added terminal functionality