allow rootdir to be specified