accomodate directory structure in functions