deal with paths for files, complete ch8