Changed dir structure.  Allow null as an input parameter