Changes in cd1 function to scan for subdirs if provided one.