some prelim work on expand_dirs
comment added