works but needs to account for files/directories with spaces in their name