updated dfm() with a hierarchical dictionary method

Thanks Kohei!!