dir.c rehauled -- starting over from scratch