dynamic allocation of tty slots; save tty hash structure (from ks@purdue)