add a synchronous version of dirtree for comparison