Added check_dir.m and check_file.m