updated to use DIRS.mat