added two-tailed terminal stuff