This array has 9 elements (including Dir_nodir). Should this be mine_dirs[9]?