Change dirs from lists to dicts.